<?php
## include required files
/*******************************/
require_once '../../includefiles.php';
require_once '../../model/message.php';
require_once '../../redirect.php';

checkUserLogin();

## Create Objects
/*******************************/
$msgObj = new Model_Message();
/*******************************/

$msgId = base64_decode($_GET['id1']);
$page  = $_GET['id2'];
$label  = $_GET['id3'];

$msgObj->deleteMessageValueById($msgId);

$_SESSION['msg']="<div class='success_msg' style='margin-bottom:15px'><span>Message Deleted Successfully.</span></div>";
if($label == 'inbox')
{
	header("Location: ".SITE_URL."/myaccount/".$page."/mymessages");
	exit;
}
else
{
	header("Location: ".SITE_URL."/myaccount/".$page."/mysentmessages");
	exit;
}
?>